package com.hy.erp.inventory.pojo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries ;
import javax.persistence.NamedQuery ;
import javax.persistence.Table;

import org.hibernate.annotations.Index;
//import org.jboss.seam.ScopeType;
//import org.jboss.seam.annotations.Name;
//import org.jboss.seam.annotations.Scope;

import com.hy.erp.inventory.dao.interfaces.IContactDao;
import com.hy.erp.inventory.pojo.interfaces.IContact;
import com.hy.erp.inventory.pojo.interfaces.IConversionStyle;
import com.hy.mydesktop.shared.persistence.domain.gxt.MyBaseModel;
//import com.hy.erp.inventory.vsoft.libra.enterprise.framework.persistence.api.annotation.DaoA;
//import com.hy.erp.inventory.vsoft.libra.enterprise.framework.persistence.entity.AbstractPersistentEntity;

/**
 * <ul>
 * <li>开发作者：汤莉</li>
 * <li>设计日期：2010-10-5；时间：下午21:27:40</li>
 * <li>字段类型：long；字段名称：serialVersionUID</li>
 * <li>设计目的：联系方式</li>
 * </ul>
 * <ul>
 * <b>修订编号：</b>
 * <li>修订日期：</li>
 * <li>修订作者：</li>
 * <li>修订原因：</li>
 * <li>修订内容：</li>
 * </ul>
 */
/*@Entity
@Name("contact")
@Scope(ScopeType.SESSION)
@Table(name="contacts")
@ DaoA ( IContactDao.class )
@ NamedQueries (
            	{
            		@ NamedQuery ( name = "findContantByPersonId" , query = "select p.contact from Person p where p.identifier=?"
            															

            		),
            		@ NamedQuery ( name = "findContantByOrganisationId" , query ="select o.contact from Organisation o where o.identifier=?"

)
            	} )*/
//public class Contact extends AbstractPersistentEntity implements IContact {
public class Contact extends MyBaseModel{ //implements IPositonType

	private static final long serialVersionUID = -3362241271049758561L;

	
	
	/**
	 * 构造函数
	 */
	public Contact(){}

	


	//#################################################################################

	

	@Column(name="contactNumber",unique=false,nullable=false,insertable=true,updatable=true)
	@Index(name="contactNumberIndex")
	public String getContactNumber() {
		return this.get(IContact.CONTACTNUMBER) ;
	}

	@Column(name="contactUse",unique=false,nullable=false,insertable=true,updatable=true)
	@Index(name="contactUseIndex")
	public String getContactUse() {
		return this.get(IContact.CONTACTUSE) ;
	}

	@ManyToOne(targetEntity=ContactType.class,fetch=FetchType.LAZY)
	public ContactType getContactType ( )
	{
		return this.get(IContact.CONTACTTYPE) ;
	}

	//#################################################################################
	
	
	public void setContactNumber(String contactNumber) {
		super.set (IContact.CONTACTNUMBER , contactNumber );
	}

	public void setContactUse(String contactUse) {
		super.set (IContact.CONTACTUSE , contactUse );
	}

	public void setContactType (
									ContactType contactType )
	{
		super.set (IContact.CONTACTTYPE , contactType );
	}

	@Column(name="description",length=100)
	@Index(name="descriptionIndex")
	public String getDescription ( )
	{
		return this.get(IContact.DESCRIPTION) ;
	}

	public void setDescription (
									String description )
	{
		super.set ( IContact.DESCRIPTION , description ) ;
	}
}
